<include file="Admin:header" />
<load href="./Public/Js/swfupload.js"/>
<div id="msg"></div>
<form name="myform" id="myform" action="<if condition="$action_name=='add'">{:U($module_name.'/insert')}<else />{:U($module_name.'/update')}</if>" method="post">
<div id="filelist" class="hide"></div>
<div class="error"><ul></ul></div>
<table cellpadding=0 cellspacing=0 class="table_form" width="100%">
	<tr>
		<td width="120"><font color="red">*</font>地区</td>
        <td id="box_province">
			<select id="province" name="province">
            	<option value="0">--请选择--</option>
                <volist name="province" id="p">
                <option value="{$p['provinceid']}"{:selected($p['provinceid'],$vo['province'])}>{$p['province']}</option>
                </volist>
            </select>
            <select id="city" name="city">
            	<option value="0">--请选择--</option>
                <volist name="city" id="p">
                <option value="{$p['cityid']}"{:selected($p['cityid'],$vo['city'])}>{$p['city']}</option>
                </volist>
            </select>
            <select id="area" name="area">
            	<option value="0">--请选择--</option>
                <volist name="area" id="p">
                <option value="{$p['areaid']}"{:selected($p['areaid'],$vo['area'])}>{$p['area']}</option>
                </volist>
            </select>
            
		</td>
	</tr>
<volist name="fields" id="r">
<if condition="!empty($r['status'])">
	<tr>
		<td width="120">{if: $r['required']}<font color="red">*</font>{if:/}{$r.name}</td>
        <td id="box_{$r['field']}">
		{$r|getform=$form,###}
		</td>
	</tr>
</if>
</volist>

		</table>
		<div id="bootline"></div>
		<div id="btnbox" class="btn">
		<if condition="$vo['id']!=''"><input TYPE="hidden" name="id" value="{$vo.id}"></if>
		<INPUT TYPE="submit"  value="{:L('dosubmit')}" class="button" >
		<input TYPE="reset"  value="{:L('cancel')}" class="button">
		</div>
{__TOKEN__}
</form>
</div>
<script language="javascript">
var purl=URL+'/ajax_area';
$("#province").change(
	function(){
		var pid=this.value;
		$.get(purl,{pid:pid,act:'city'},function(data){
			$('#city').html(data);
			$('#area').html('<option value="0">--请选择--</option>');
		});
	}
);
$("#city").change(
	function(){
		var pid=this.value;
		$.get(purl,{pid:pid,act:'area'},function(data){
			$('#area').html(data);
		});
	}
);
$("#title").focusout(
	function(){
		var title=this.value;
		$.get(purl,{title:title,act:'initials'},function(data){
			$('#initials').attr('value',data);
		});
	}
);
</script>